package org.brownflat.lighthouse.web;

import net.sourceforge.stripes.action.DefaultHandler;
import net.sourceforge.stripes.action.Resolution;
import net.sourceforge.stripes.integration.spring.SpringBean;
import org.brownflat.lighthouse.cache.BuildSeriesStatistics;
import org.brownflat.lighthouse.cache.HistoryService;

import java.util.List;

/**
 * &copy; Rupert Jones 2011
 */
public class StatsAction extends AbstractAction {

    @SpringBean
    private HistoryService historyService;

    @DefaultHandler
    public Resolution view() {
        return getForwardJSPResolution("stats.jsp");
    }

    public List<BuildSeriesStatistics> getStatistics() {
        return historyService.getStatistics();
    }
}
